﻿using JX.Core.Entity;

namespace JX.EF
{
    /// <summary>
    /// 接口 用于创建DbContext的工厂类.
    /// 使用方法：在展示层的Startup.cs文件的ConfigureServices方法中，添加services.AddScoped《IDbContextFactory, DbContextFactory》();
    /// </summary>
	public interface IDbContextFactory
	{
        /// <summary>
        /// 根据枚举，分别创建DbContext
        /// </summary>
        /// <param name="writeAndRead"></param>
        /// <returns></returns>
		public ApplicationDbContext CreateDbContext(WriteAndReadEnum writeAndRead);
	}
}
